﻿using System.Collections.Generic;
using System.Diagnostics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace WRCControl
{
    public sealed class VariableSizeWrapGridView : GridView
    {
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            Debug.WriteLine(item.GetType().ToString());
            IList<IVariableSizeWrapGridItem> items = (IList<IVariableSizeWrapGridItem>)item;
            IVariableSizeWrapGridItem variableItem = item as IVariableSizeWrapGridItem;
            element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, variableItem.ColSpan);
            element.SetValue(VariableSizedWrapGrid.RowSpanProperty, variableItem.RowSpan);
            base.PrepareContainerForItemOverride(element, item);
        }
    }
}
